@extends('home.base.person')
@section('content')
<div class="suggestmain">
	@if(session('msg'))
		<h1 style="color:green;">{{ session('msg') }}</h1>
	@endif
	<div class="am-cf am-padding">
		
		<div class="am-fl am-cf"><strong class="am-text-danger am-text-lg">意见反馈</strong> / <small>Suggest</small></div>
	</div>
	<hr/>
	<p>请留下您的宝贵意见：</p>
	<form method="post" name="myForm">
		{{ csrf_field() }}
		<div class="suggestlist">
			<select data-am-selected name="title" id="pid">
				<option value="0" selected >请选择意见类型</option>
				<option value="产品问题">产品问题</option>
				<option value="促销问题">促销问题</option>
				<option value="支付问题">支付问题</option>
				<option value="退款问题">退款问题</option>
				<option value="配送问题">配送问题</option>
				<option value="售后问题">售后问题</option>
				<option value="发票问题">发票问题</option>
				<option value="退换货">退换货</option>
				<option value="其他">其他</option>
			</select>
			<span style="display:none; color:red;" id="notice">请选择意见类型</span>
		</div>
		<div class="suggestDetail">
			<br><br><br>
			<blockquote class="textArea">
				<textarea name="content" id="say_some" cols="60" rows="5" autocomplete="off" placeholder="在此描述您的意见具体内容"></textarea>
				<div class="fontTip"><i class="cur">0</i> / <i>200</i></div>
			</blockquote>
		</div>
		<div class="am-btn am-btn-danger anniu" id="submit" onclick="doSubmit()">提交</div>
	</form>
	<p class="suggestTel"><i class="am-icon-phone"></i>客服QQ：531946543</p>
</div>
<script type="text/javascript">
	function doSubmit(){
		var pid = document.getElementById("pid").value;
		var notice = document.getElementById('notice');
		if(pid != 0){
			var form = document.myForm;
			form.action = "{{ url('home/person/suggest') }}";
			form.submit();
		}else{
			notice.style.display = 'block';
			alert('请选择意见类型');
		}
	}
</script>
@endsection